Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test create gauge fees #2228

Merged
merged 9 commits into from
Jul 24, 2022
Merged

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Jul 24, 2022

Closes: #XXX

What is the purpose of the change

Adds GaugeCreation fee check tests. Working tests in tandem with Roman.

Comment on lines 302 to 310
// TODO: This is unexpected behavior
// We need validation to not charge fee if user doesn't have enough funds
// {
// name: "one user tries to create a gauge, has enough funds to pay for the create gauge fee but not enough to fill the gauge",
// accountBalanceToFund: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(60000000))),
// gaugeAddition: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(30000000))),
// expectedEndBalance: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(60000000))),
// expectErr: true,
// },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unexpected behavior
We need validation to not charge fee if user doesn't have enough funds

@czarcas7ic czarcas7ic marked this pull request as ready for review July 24, 2022 20:21
@czarcas7ic czarcas7ic requested a review from a team July 24, 2022 20:21
@github-actions github-actions bot added the C:app-wiring Changes to the app folder label Jul 24, 2022
@czarcas7ic czarcas7ic marked this pull request as draft July 24, 2022 21:11
@github-actions github-actions bot removed the C:app-wiring Changes to the app folder label Jul 24, 2022
@p0mvn p0mvn marked this pull request as ready for review July 24, 2022 22:02
@p0mvn p0mvn merged commit 590349f into roman/txfees-simplified Jul 24, 2022
@p0mvn p0mvn deleted the adam/tx-fees-simplified branch July 24, 2022 22:02
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
* feat(incentives)!: create gauge and add to gauge fee charge

* initialize txfees keeper before incentives

* finish TestChargeFee

* refactor to charge fee in message server

* more tests

* clean up

* test balances

* test create gauge fees (#2228)

* test create gauge fees

* add mod account to test

* test create gauge fees

* add mod account to test

* move to msg server

* merge

* add comments

* account keeper comment

* fix TestCreateGaugeFee

* apply appparams.BaseCoinUnit

* remove txfees keeper from incentives and revert order

* clean up

* remove unused keepers fromm incentives keeper

* Update x/incentives/keeper/gauge.go

* Update x/incentives/keeper/gauge.go

* clean up

* fixture names

* chargeFeeIfSufficientFeeDenomBalance test name

* changelog

* comment

* finished tests (#2230)

* finished tests

* use keeper instead of math

* remove unused tests

* clean up

* sim only allow accounts with enough to pay fee

* lint

* move fee to types and reuse in simulation (#2234)

Co-authored-by: Adam Tucker <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
* feat(incentives)!: create gauge and add to gauge fee charge

* initialize txfees keeper before incentives

* finish TestChargeFee

* refactor to charge fee in message server

* more tests

* clean up

* test balances

* test create gauge fees (#2228)

* test create gauge fees

* add mod account to test

* test create gauge fees

* add mod account to test

* move to msg server

* merge

* add comments

* account keeper comment

* fix TestCreateGaugeFee

* apply appparams.BaseCoinUnit

* remove txfees keeper from incentives and revert order

* clean up

* remove unused keepers fromm incentives keeper

* Update x/incentives/keeper/gauge.go

* Update x/incentives/keeper/gauge.go

* clean up

* fixture names

* chargeFeeIfSufficientFeeDenomBalance test name

* changelog

* comment

* finished tests (#2230)

* finished tests

* use keeper instead of math

* remove unused tests

* clean up

* sim only allow accounts with enough to pay fee

* lint

* move fee to types and reuse in simulation (#2234)

Co-authored-by: Adam Tucker <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
…2227) (#2237)

* feat(incentives)!: create gauge and add to gauge fee charge (#2227)

* feat(incentives)!: create gauge and add to gauge fee charge

* initialize txfees keeper before incentives

* finish TestChargeFee

* refactor to charge fee in message server

* more tests

* clean up

* test balances

* test create gauge fees (#2228)

* test create gauge fees

* add mod account to test

* test create gauge fees

* add mod account to test

* move to msg server

* merge

* add comments

* account keeper comment

* fix TestCreateGaugeFee

* apply appparams.BaseCoinUnit

* remove txfees keeper from incentives and revert order

* clean up

* remove unused keepers fromm incentives keeper

* Update x/incentives/keeper/gauge.go

* Update x/incentives/keeper/gauge.go

* clean up

* fixture names

* chargeFeeIfSufficientFeeDenomBalance test name

* changelog

* comment

* finished tests (#2230)

* finished tests

* use keeper instead of math

* remove unused tests

* clean up

* sim only allow accounts with enough to pay fee

* lint

* move fee to types and reuse in simulation (#2234)

Co-authored-by: Adam Tucker <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>

* merge gauge fee changes

* go mod updates

Co-authored-by: Roman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants